package com.heyige.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "app")
public class AppConfig {

    private JwtConfig jwt;
    private CorsConfig cors;
    private QuotaConfig quota;
    private UploadConfig upload;
    private EmailConfig email;

    @Data
    public static class JwtConfig {
        private String secret;
        private Long expiration;
    }

    @Data
    public static class CorsConfig {
        private String[] allowedOrigins;
        private String[] allowedMethods;
        private String[] allowedHeaders;
    }

    @Data
    public static class QuotaConfig {
        private Integer dailyFree;
        private Integer shareReward;
    }

    @Data
    public static class UploadConfig {
        private String maxFileSize;
        private String[] allowedExtensions;
    }

    @Data
    public static class EmailConfig {
        private String host;
        private Integer port;
        private String username;
        private String password;
        private String protocol;
        private Boolean sslEnabled;
        private String adminEmail;
    }
}